﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FJERP.Model;
using FJERP.DAL;
using System.Data.SqlClient;
using System.Data;

namespace FJERP.BLL
{
    public class MemberCardBLL
    {
        MemberCardDAL dal = new MemberCardDAL();
        /// <summary>
        /// 分页显示会员列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <returns></returns>
        public List<MemberCard> ShowMemberCard(int PageSize, int PageIndex)
        {

            return dal.ShowMemberCard(PageSize, PageIndex);
        }
        /// <summary>
        /// 获取总记录数
        /// </summary>
        /// <returns></returns>
        public int Count()
        {
            return dal.Count();
        }

        /// <summary>
        /// 会员信息添加
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public int MenBerCardAdd(MemberCard m)
        {
            return dal.MenBerCardAdd(m);
        }
        /// <summary>
        /// 根据编号获取
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string GetMemberById(int id)
        {
            return dal.GetMemberById(id);
        }
        /// <summary>
        /// 修改会员
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public int Upd(MemberCard m)
        {
            return dal.Upd(m);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int Del(int id)
        {
            return dal.Del(id);
        }
        /// <summary>
        /// 查询会员列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <returns></returns>
        public List<MemberCard> ShowMemberCard_Sel(int PageSize, int PageIndex, string MemberCard_owner, string MemberCard_Name)
        {
            return dal.ShowMemberCard_Sel(PageSize, PageIndex, MemberCard_owner, MemberCard_Name);
        }
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="MemberCard_State"></param>
        /// <param name="MemberCard_Id"></param>
        /// <returns></returns>
        public int UptState(int MemberCard_State, int MemberCard_Id)
        {
            return dal.UptState(MemberCard_State, MemberCard_Id);
        }
    }
}
